LassoScript Utility
Basics Browse Detail

[Null->IsA]

Tag Link [Null->IsA] Category Tags
Type Member Source Available No
Support Preferred Version 6.0
Change Unchanged Data Source Any
Output Type Boolean Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Description

Requires a type name as a parameter. Returns True if the base object is of that type or has that type as a parent type.

Note that Null is the base type for all objects in Lasso. Using [Null->Isa: 'Null'] will always return true. To check whether a value does not have a value it is better to use the === operator. [If: $value === Null] ... [/If].

Syntax

[Null->(IsA: 'Type Name']

Parameters

Required Parameters
Type Name The type to check.

Examples

To check the type of an object:

Use the [Null->IsA] tag. The following example checks a variable to see whether it is a string before performing a string operation on it.

[Variable: 'myString' = 'red,green,blue']
[If: $myString->(IsA: 'string')]
  [Variable: 'myArray' = $myString->(Split: ',')]
[Else]
  [Variable: 'myArray' = (Array)]
[/If]
[Output: $myArray]

(Array: (Red), (Green), (Blue))